package com.easyidea.its.domain.model.surveillance;

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.easyidea.its.domain.model.system.Department;
import com.easyidea.its.domain.model.system.User;

/**
 * 
 * @author kangning.hu
 * 
 */
@Entity
@Table(name = "cancle_surveillance")
public class CancleSurveillance {

	private Integer surveillanceID;// 布控ID smallint 10
	private Department cancleDept;// 撤控部门代码 smallint 10
	private User cancleUser;// 撤控用户ID smallint 10
	private String cancleReson;// 撤控原因 nvarchar 128
	private Date cancleDate;// 撤控时间 datetime 0
	private String surveillanceResult;// 布控反馈结果 nvarchar 128

	private Surveillance surveillance;

	@Id
	@Column(name = "surveillanceID")
	public Integer getId() {
		return surveillanceID;
	}

	@OneToOne(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
	@JoinColumn(name = "surveillanceID", referencedColumnName = "surveillanceID")
	public Surveillance getSurveillance() {
		return surveillance;
	}

	@OneToOne(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
	@JoinColumn(name = "cancleUserID", referencedColumnName = "id")
	public User getCancleUser() {
		return cancleUser;
	}

	@OneToOne(cascade = CascadeType.MERGE, fetch = FetchType.LAZY)
	@JoinColumn(name = "cancleDeptCode", referencedColumnName = "id")
	public Department getCancleDept() {
		return cancleDept;
	}

	public void setCancleDept(Department cancleDept) {
		this.cancleDept = cancleDept;
	}

	@Column(name = "cancleReson")
	public String getCancleReson() {
		return cancleReson;
	}

	@Column(name = "cancleDate")
	public Date getCancleDate() {
		return cancleDate;
	}

	@Column(name = "surveillanceResult")
	public String getSurveillanceResult() {
		return surveillanceResult;
	}

	public void setId(Integer surveillanceID) {
		this.surveillanceID = surveillanceID;
	}

	public void setCancleUser(User cancleUser) {
		this.cancleUser = cancleUser;
	}

	public void setCancleReson(String cancleReson) {
		this.cancleReson = cancleReson;
	}

	public void setCancleDate(Date cancleDate) {
		this.cancleDate = cancleDate;
	}

	public void setSurveillanceResult(String surveillanceResult) {
		this.surveillanceResult = surveillanceResult;
	}

	public void setSurveillance(Surveillance surveillance) {
		this.surveillance = surveillance;
	}

}
